package com.boc.langxiang.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

import com.boc.langxiang.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Li Guoxi on 2016/12/21.
 */

public class CustomizedResultDialog extends Dialog {
    @BindView(R.id.close_iv)
    ImageView closeIv;

    public CustomizedResultDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Window window = getWindow();
        window.setGravity(Gravity.CENTER);
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        setContentView(R.layout.customized_result_dialog);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
        closeIv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

}
